package com.zhonghui.modlules.order.eshopDomain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;

import javax.validation.constraints.NotBlank;

@TableName("express")
public class EshopExpress extends BaseDomain {
    @TableId
    private Integer id;
    @NotBlank(
            message = "请输入快递公司编号"
    )
    private String code;
    @NotBlank(
            message = "请输入快递公司名称"
    )
    private String name;
    private Integer sort;
    private Integer isShow;

    public void copy(EshopExpress source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public EshopExpress() {
    }

    public Integer getId() {
        return this.id;
    }

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public Integer getSort() {
        return this.sort;
    }

    public Integer getIsShow() {
        return this.isShow;
    }

    public void setId(final Integer id) {
        this.id = id;
    }

    public void setCode(final String code) {
        this.code = code;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public void setSort(final Integer sort) {
        this.sort = sort;
    }

    public void setIsShow(final Integer isShow) {
        this.isShow = isShow;
    }

    public String toString() {
        return "EshopExpress(id=" + this.getId() + ", code=" + this.getCode() + ", name=" + this.getName() + ", sort=" + this.getSort() + ", isShow=" + this.getIsShow() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof EshopExpress)) {
            return false;
        } else {
            EshopExpress other = (EshopExpress)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (!super.equals(o)) {
                return false;
            } else {
                label73: {
                    Object this$id = this.getId();
                    Object other$id = other.getId();
                    if (this$id == null) {
                        if (other$id == null) {
                            break label73;
                        }
                    } else if (this$id.equals(other$id)) {
                        break label73;
                    }

                    return false;
                }

                Object this$sort = this.getSort();
                Object other$sort = other.getSort();
                if (this$sort == null) {
                    if (other$sort != null) {
                        return false;
                    }
                } else if (!this$sort.equals(other$sort)) {
                    return false;
                }

                label59: {
                    Object this$isShow = this.getIsShow();
                    Object other$isShow = other.getIsShow();
                    if (this$isShow == null) {
                        if (other$isShow == null) {
                            break label59;
                        }
                    } else if (this$isShow.equals(other$isShow)) {
                        break label59;
                    }

                    return false;
                }

                Object this$code = this.getCode();
                Object other$code = other.getCode();
                if (this$code == null) {
                    if (other$code != null) {
                        return false;
                    }
                } else if (!this$code.equals(other$code)) {
                    return false;
                }

                Object this$name = this.getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof EshopExpress;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = super.hashCode();
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $sort = this.getSort();
        result = result * 59 + ($sort == null ? 43 : $sort.hashCode());
        Object $isShow = this.getIsShow();
        result = result * 59 + ($isShow == null ? 43 : $isShow.hashCode());
        Object $code = this.getCode();
        result = result * 59 + ($code == null ? 43 : $code.hashCode());
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        return result;
    }
}

